<template>
  <div class="wrap">
    <div class="wrap-button">
      <a-button style="margin-right: 8px" type="primary" @click="showAddRole">临时新增</a-button>
      <a-button style="margin-right: 8px" type="primary" @click="showAddRole">导出</a-button>
      <div style="float: right">
        <a-input
          v-model:value="keyword"
          style="width: 180px; margin-right: 8px"
          placeholder="输入单据关键字查询"
          allow-clear
        >
          <template #prefix>
            <SearchOutlined style="color: #666" />
          </template>
        </a-input>

        <a-button type="primary" @click="handleSearch">查询</a-button>
      </div>
    </div>
    <div class="wrap-table">
      <!-- <BaseTitle title="用户列表" /> -->
      <a-table
        :loading="loading"
        :dataSource="data"
        :columns="columns"
        size="middle"
        @change="handleTableChange"
        width="300"
      >
        <template #bodyCell="{ column, record }">
          <template v-if="column.key === 'operation'">
            <a-button class="button-interval" type="link" size="small"> 删除 </a-button>
            <a-button class="button-interval" type="link" size="small"> 完成 </a-button>
          </template>
        </template>
      </a-table>
    </div>
  </div>
</template>
<script lang="ts" setup>
  import { ref } from 'vue'
  import { RoleInfo } from '/@/api/sys/model/roleModel'
  const loading = ref(false)

  const columns = [
    {
      title: '资产名称',
      dataIndex: 'assetName',
      key: 'assetName',
      align: 'center',
    },
    {
      title: '资产EPC',
      dataIndex: 'epc',
      key: 'epc',
      align: 'center',
    },
    {
      title: '客户名称',
      key: 'clientName',
      fixed: 'clientName',
      align: 'center',
    },
    {
      title: '位置',
      dataIndex: 'position',
      key: 'position',
      align: 'center',
    },
    {
      title: '资产状态',
      dataIndex: 'assetStatus',
      key: 'assetStatus',
      align: 'center',
    },
    {
      title: '盘点状态',
      dataIndex: 'inventoryStatus',
      key: 'inventoryStatus',
      align: 'center',
    },
    {
      title: '操作',
      dataIndex: 'operation',
      key: 'operation',
      align: 'center',
      with: 180,
    },
  ]

  let data = ref<RoleInfo[]>([])
</script>
<style lang="scss" scoped>
  .wrap {
    &-table {
      margin-top: 16px;
    }
  }
</style>
